﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DigDes.DSchool.SUPS.DataAccess.Database
{
    public abstract class BaseDAC
    {
        private static readonly string ConnectionStringKey = "SUPSDB";
        protected static string connectionString = ConfigurationManager.ConnectionStrings[ConnectionStringKey].ConnectionString;

        protected static string ConvertFromDBDataToString(object obj)
        {
            if (obj is DBNull)
                return "";
            else
                return obj.ToString();
        }

        protected static byte[] ConvertFromDBDataToByteArray(object obj)
        {
            if (obj is DBNull)
                return null;
            else
                return (byte[])obj;
        }
        
    }
}
